package net.gxtvsgwt.client.demo.type;

import net.gxtvsgwt.client.demo.BaseDemo;

import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

public class SmallMixDemo extends BaseDemo {

	@Override
	public Widget createGxt() {

		HorizontalPanel panel = new HorizontalPanel();

		for (int i = 0; i < dataSize; i++) {

			com.extjs.gxt.ui.client.widget.form.TextField<String> input = new com.extjs.gxt.ui.client.widget.form.TextField<String>();

			com.extjs.gxt.ui.client.widget.form.CheckBox checkbox = new com.extjs.gxt.ui.client.widget.form.CheckBox();
			com.extjs.gxt.ui.client.widget.Label label = new com.extjs.gxt.ui.client.widget.Label(
					"Advanced");
			com.extjs.gxt.ui.client.widget.button.Button button = new com.extjs.gxt.ui.client.widget.button.Button(
					"Search");

			com.extjs.gxt.ui.client.widget.HorizontalPanel buttons = new com.extjs.gxt.ui.client.widget.HorizontalPanel();
			buttons.add(checkbox);
			buttons.add(label);
			buttons.add(button);

			com.extjs.gxt.ui.client.widget.VerticalPanel search = new com.extjs.gxt.ui.client.widget.VerticalPanel();
			search.add(input);
			search.add(buttons);

			panel.add(search);
		}

		return panel;
	}

	@Override
	public Widget createGwt() {

		HorizontalPanel panel = new HorizontalPanel();

		for (int i = 0; i < dataSize; i++) {

			TextBox input = new TextBox();

			CheckBox checkbox = new CheckBox();
			Label label = new Label("Advanced");
			Button button = new Button("Search");

			HorizontalPanel buttons = new HorizontalPanel();
			buttons.add(checkbox);
			buttons.add(label);
			buttons.add(button);

			VerticalPanel search = new VerticalPanel();
			search.add(input);
			search.add(buttons);

			panel.add(search);
		}

		return panel;
	}

	@Override
	public String getName() {
		return "Small Mix - Search";
	}
}
